package cn.iocoder.yudao.module.enterprise.controller.admin.interviewInvite;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.api.interviewInvite.InterviewInviteApi;
import cn.iocoder.yudao.module.member.api.interviewInvite.dto.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Api(tags = "管理后台 -企业端- 面试邀约")
@RestController
@RequestMapping("/enterprise/interview-invite")
@Validated
public class EnterpriseInterviewInviteController {

    @Resource
    private InterviewInviteApi interviewInviteApi;

    @PostMapping("/create")
    @ApiOperation("创建面试邀约")
    public CommonResult<Long> createInterviewInvite(@Valid @RequestBody InterviewInviteCreateReqDTO createReqVO) {
        return success(interviewInviteApi.createInterviewInvite(createReqVO));
    }

    @PostMapping("/createList")
    @ApiOperation("创建面试邀约")
    @TenantIgnore
    public CommonResult<Boolean> createInterviewInviteList(@Valid @RequestBody List<InterviewInviteCreateReqDTO> interviewInviteCreateReqDTOS) {
        return success(interviewInviteApi.createInterviewInviteList(interviewInviteCreateReqDTOS));
    }

    @PostMapping("/inSend")
    @ApiOperation("直接面试邀约")
    public CommonResult<Long> createSendInterviewInvite(@Valid @RequestBody SendInterviewInviteCreateReqDTO createReqVO) {
        return success(interviewInviteApi.createSendInterviewInvite(createReqVO));
    }

    @PostMapping("/inSendBatch")
    @ApiOperation("直接面试邀约")
    public CommonResult<List<Long>> createSendInterviewInviteBatch(@Valid @RequestBody List<SendInterviewInviteCreateReqDTO> createReqVO) {
        return success(interviewInviteApi.createSendInterviewInviteBatch(createReqVO));
    }


    @PostMapping("/update")
    @ApiOperation("更新面试邀约")
    public CommonResult<Boolean> updateInterviewInvite(@Valid @RequestBody InterviewInviteUpdateReqDTO updateReqDTO) {
        return success(interviewInviteApi.updateInterviewInvite(updateReqDTO));
    }

    @PostMapping("/page")
    @ApiOperation("获得面试邀约分页")
    public CommonResult<PageResult<InterviewInviteRespDTO>> getInterviewInvitePage(@Valid @RequestBody InterviewInvitePageReqDTO pageVO) {
        PageResult<InterviewInviteRespDTO> pageResult = interviewInviteApi.getInterviewInvitePage(pageVO);
        return success(pageResult);
    }



    @GetMapping("/invitationRecord")
    @ApiOperation("获得面试邀约列表")
    public CommonResult<List<InterviewInviteRespDTO>> invitationRecord(@Valid InterviewInviteReqDTO reqDTO) {
        return success(interviewInviteApi.invitationRecord(reqDTO));
    }

    @GetMapping("/invitedFeedback")
    @ApiOperation("获得面试邀约反馈")
    public CommonResult<InterviewInviteRespDTO> InvitedFeedback(@RequestParam("id") Long id) {
        return success(interviewInviteApi.InvitedFeedback(id));
    }



  

}
